Add gdk_wayland_device_get_xkb_keymap
authorMatthias Clasen <mclasen@redhat.com>
Mon, 26 Apr 2021 03:34:39 +0000 (23:34 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 3 May 2021 01:02:09 +0000 (21:02 -0400)
This can be useful to get more detailed information
about keyboard configuration.

gdk/wayland/gdkdevice-wayland.c
gdk/wayland/gdkwaylanddevice.h

index 237c23ca03e1c21e5c207a6f462a1777a5370359..564408dc0a88d8ed37bda6fa5a7f0aa8fe7fe308 100644 (file)
@@ -1037,6 +1037,23 @@ gdk_wayland_device_get_wl_keyboard (GdkDevice *device)
   return seat->wl_keyboard;
 }
 
+/**
+ * gdk_wayland_device_get_xkb_keymap:
+ * @device: (type GdkWaylandDevice): a `GdkDevice`
+ *
+ * Returns the `xkb_keymap` of a `GdkDevice`.
+ *
+ * Returns: (transfer none): a `struct xkb_keymap`
+ *
+ * Since: 4.4
+ */
+struct xkb_keymap *
+gdk_wayland_device_get_xkb_keymap (GdkDevice *device)
+{
+  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (device));
+  return _gdk_wayland_keymap_get_xkb_keymap (seat->keymap);
+}
+
 GdkKeymap *
 _gdk_wayland_device_get_keymap (GdkDevice *device)
 {
index fbd51b6fe1af1369524b2d67ec83c382f8ebf95f..1a3c119c649ca8145048f87215326a76e367a7cb 100644 (file)
@@ -52,6 +52,8 @@ GDK_AVAILABLE_IN_ALL
 struct wl_pointer   *gdk_wayland_device_get_wl_pointer      (GdkDevice *device);
 GDK_AVAILABLE_IN_ALL
 struct wl_keyboard  *gdk_wayland_device_get_wl_keyboard     (GdkDevice *device);
+GDK_AVAILABLE_IN_4_4
+struct xkb_keymap   *gdk_wayland_device_get_xkb_keymap      (GdkDevice *device);
 
 GDK_AVAILABLE_IN_ALL
 const char          *gdk_wayland_device_get_node_path       (GdkDevice *device);